From 12af2ea309ea8f116483672d9900b863e75f0c7e Mon Sep 17 00:00:00 2001 From: "kaf24@viper.(none)" Date: Sun, 3 Apr 2005 13:17:25 +0000 Subject: [PATCH] bitkeeper revision 1.1236.1.207 (424fece5IsVIZO7m8xtxHyuGSvbJCQ) Fix context switching between VCPUs belonging to the same domain. Setting and then clearing the physical CPU bit in the cpuset bitmap is incorrect. Signed-off-by: Keir Fraser --- xen/arch/x86/domain.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 53d1ea6e3b..efcc269f9b 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -808,10 +808,14 @@ static void __context_switch(void) } } - set_bit(cpu, &n->domain->cpuset); + if ( p->domain != n->domain ) + set_bit(cpu, &n->domain->cpuset); + write_ptbase(n); __asm__ __volatile__ ( "lgdt %0" : "=m" (*n->arch.gdt) ); - clear_bit(cpu, &p->domain->cpuset); + + if ( p->domain != n->domain ) + clear_bit(cpu, &p->domain->cpuset); percpu_ctxt[cpu].curr_ed = n; } -- 2.30.2